package com.yztstudy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 地址实体类
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "address")
public class Address implements Serializable {

    public static final Long serialVersionUID = 1L;

    // 成员变量
    @TableId(value = "id", type = IdType.AUTO)
    private Long id; // 主键

    @TableField(value = "linkman")
    @NotBlank
    private String linkman; // 联系人

    @TableField(value = "phone")
    @NotBlank
    private String phone; // 手机号

    @TableField(value = "address")
    @NotBlank
    private String address; // 详细地址

    @TableField(value = "user_id")
    private Integer userId; // 用户主键

}
